﻿using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace DomainExample.Extensions.Tests
{
    [TestClass]
    public sealed class StringExtensionsIsNullOrWhitespaceTests
    {
        [TestMethod]
        public void StringIsNullOrWhitespaceWithNonEmptyStringExpectFalse()
        {
            const string inputString = "x";
            var result = inputString.IsNullOrWhitespace();
            Assert.IsFalse(result);
        }

        [TestMethod]
        public void StringIsNullOrWhitespaceWithWhitespaceStringExpectTrue()
        {
            const string inputString = "   ";
            var result = inputString.IsNullOrWhitespace();
            Assert.IsTrue(result);
        }

        [TestMethod]
        public void StringIsNullOrWhitespaceWithEmptyStringExpectTrue()
        {
            const string inputString = "";
            var result = inputString.IsNullOrWhitespace();
            Assert.IsTrue(result);
        }

        [TestMethod]
        public void StringIsNullOrWhitespaceWithNullStringExpectTrue()
        {
            const string inputString = null;
            var result = inputString.IsNullOrWhitespace();
            Assert.IsTrue(result);
        }
    }
}
